#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@File Name  : test.py
@Author     : LeeCQ
@Date-Time  : 2019/11/30 20:49

"""

import requests

from root_class import Root9C
from c_picture import Picture9C
from c_video import Video9C
from c_book import Book9C


class Test(Book9C, Picture9C, Video9C, ):
    def __init__(self):
        super().__init__()

    def index_page(self):
        url = 'http://' + self.HOST + '/'
        _r = requests.get(url, self.HEADER)
        print(_r)

    def for_pic_json(self):
        """
            [one_dict{  'a_id',     int()
                        'a_name',   Name
                        'a_pic',    URL - a picture
                        'a_remarks',URL - a picture
                        'a_type',   int()
                        'a_time'    时间 -
        }, and more dict {},
    ]
        :return:
        """
        for dic_ in self.get_all_json():
            for key, txt_data in dic_.items():
                for txt_item in txt_data:
                    print(txt_item)
                    # print(txt_item.keys())
                    # print(txt_item['a_time'])
                # print(txt_data.k)
                # print(key, txt_data)

    def for_vio_json(self):
        for dic_ in self.get_all_json_video():
            for key, txt_data in dic_.items():
                for txt_item in txt_data:
                    print(txt_item.keys())

    def for_book_json(self):
        for list_ in self.get_json_book_inOne():
            # return list_
            for dic_ in list_:
                print(dic_)


if __name__ == '__main__':
    test = Test()
    test.for_book_json()
